package Demo2;

import java.util.Comparator;

/*
 *Description:
 *User:laoHu
 *Created with Intellij IDEA 2025
 *Data:2025.05.00
 *Time:00:00
 */
public class AgeComparator implements Comparator<Student> {

    //重写compare方法
    @Override
    public int compare(Student o1 ,Student o2){

       return o1.age - o2.age;
    }
}


